//
// Created by francklinson on 2021/12/31 AT 10:31.
//
#include <iostream>
#include <string>

using namespace std;

class Solution {
public:
    int minimumMoves(string s) {
        int ans = 0;
        int i = 0;
        while (i < s.size()) {
            if (s[i] == 'X') {
                ++ans;
                i += 3;
            } else {
                ++i;
            }
        }
        return ans;
    }
};

int main() {
    Solution solution;
    cout << solution.minimumMoves("XXOX") << endl;
    cout << solution.minimumMoves("XXX") << endl;
    cout << solution.minimumMoves("OOO") << endl;
    return 0;
}

